<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Java AQS 之读写锁 - 知其所以然</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<link rel="canonical" href="http://example.com/2021/02/24/xuyuntian/java/io_and_thread/aqs_rw/">
<link rel="icon" type="image/x-icon" href="/imgs/advator.webp">

<meta name="description" content="读写锁 在读多写少的情况下如果对读写不加以区分的话，锁的效率会特别低。对于一种极端情况下，所有线程都只有读操作的话，加锁会严重影响效率。为了针对这种情况，java也实现了一种读写锁 ReentrantReadWriteLock。 简介 ReentrantReadWriteLock的实现依赖于AQS。 它有以下核心成员 123private final ReentrantReadWriteLock.">
<meta property="og:type" content="website">
<meta property="og:title" content="Java AQS 之读写锁">
<meta property="og:url" content="http://example.com/2021/02/24/xuyuntian/java/io_and_thread/aqs_rw/index.html">
<meta property="og:site_name" content="知其所以然">
<meta property="og:description" content="读写锁 在读多写少的情况下如果对读写不加以区分的话，锁的效率会特别低。对于一种极端情况下，所有线程都只有读操作的话，加锁会严重影响效率。为了针对这种情况，java也实现了一种读写锁 ReentrantReadWriteLock。 简介 ReentrantReadWriteLock的实现依赖于AQS。 它有以下核心成员 123private final ReentrantReadWriteLock.">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://example.com/imgs/advator.webp">
<meta property="article:published_time" content="2021-02-24T11:30:01.000Z">
<meta property="article:modified_time" content="2021-02-26T06:28:42.365Z">
<meta property="article:author" content="xuyuntian">
<meta property="article:tag" content="基础知识">
<meta property="article:tag" content="线程">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://example.com/imgs/advator.webp">


<!-- hexo injector head_end start --><link href="//fonts.googleapis.com/css?family=Baloo+Bhaijaan|Inconsolata|Josefin+Sans|Montserrat" rel="stylesheet"><link href="/styles.43478ea7e28ed563c48b.css" rel="stylesheet">
<script src="/config.b07edf6f7532fee8fcbb.js"></script>

<link rel="stylesheet" href="/theme.9a110498fb03f1829589.css" is="theme">
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.2.0"></head>
<body lang="en"><!-- hexo injector body_begin start --><is-a></is-a><!-- hexo injector body_begin end --><!-- hexo injector body_end start --><script src="/runtime.b15aa7186c559b492b7d.js"></script><script src="/polyfills.824ff89b5f3ca4543a31.js"></script><script src="/main.03652fc423a687c817e8.js"></script><!-- hexo injector body_end end --></body>
</html>
